<template>
	<div v-if="selectDevice !=null" class="flex_col card m5 p10 flex_start_self">
		<div class="flex_row_center">
			<label>设备名称:</label>
			<label>{{ selectDevice.name }}</label>
		</div>
		<div class="flex_row_center">
			<label>设备ID:</label>
			<label>{{ selectDevice.id }}</label>
		</div>
		<div class="flex_row_center">
			<el-button type="primary" @click="onClickNotify">测试通知</el-button>
		</div>
	</div>
</template>

<script lang="ts" setup>

import { notify } from '@/service/http';
import { selectDevice } from '@/service/react';
import { runAction } from '@/utils/ui';

async function onClickNotify() {
	if (selectDevice.value == null) {
			return;
	}
	const id = selectDevice.value.id;
	runAction('测试', '通知', async () => {
		await notify(id, 1, "测试通知");
	});
}


</script>
